<template>
  <div class="app-container">
         <el-button @click="overTimeFm">  时间的测试 </el-button>

  </div>
</template>

<script>

export default {
  
  data() {
    return {
      statusTime:false,
        // 超时定时器
      overTimer: null,
        // 是否超时
      isOvertime: false,
    };
  },
  created(){
  },
  mounted(){
          this.isOvertime=true
          this.overTimer = setTimeout(() => {
            console.log('55555555555555')
            console.log(this.isOvertime)
            console.log('55555555555555')
            if(this.isOvertime){
                 this.$message.error('您超时了 aaaa');
            }
          }, 5000)
  },
  destroyed () {
       // 销毁定时器
    clearTimeout(this.overTimer)
    
  },
  methods: {
      overTimeFm(){
          this.isOvertime=false
         // this.$message.error('您超时了');
      }
    
  }
};
</script>